#pragma once

#include "Type.h"
#include "DecoratedType.h"

class CClass;
class RObject;
class CPlaceholderType;

class WHENGINE_API CWeakObjectPtrType: public CType
{
public:
    CWeakObjectPtrType();

    static CWeakObjectPtrType* GetStaticType();

    static CString CreateTypeName(const CString& ElementType);
    static STypeID CreateID(const SDecoratedType & ElementType);

protected:
    static CString PlaceholderName;
};

//type of TSharedWeakObjectPtr<T> 
class WHENGINE_API CWeakObjectPtrTypeGeneralized: public CType
{
public:
    CWeakObjectPtrTypeGeneralized(CClass *InClass);

    CClass* GetObjectClass() const;

    //convert a object raw ptr to a weak object ptr
    void SetObjectPtr(void* Instance, RObject* InObject);
    RObject* GetObjectPtr(void* Instance);

};
